package com.example.mayn.secondmvp.model.utils;

import android.content.Context;
import android.widget.Toast;

import com.example.mayn.secondmvp.model.tools.HttpUtil;
import com.example.mayn.secondmvp.presenter.IPresenter;

public class MainDownLoadUtil implements HttpUtil.XCallBack {
    private IPresenter presenter;

    public MainDownLoadUtil(IPresenter presenter) {
        this.presenter = presenter;
    }

    public void getMainList() {
        String url = "http://47.100.99.201:1000/AppService.svc/GetProjectList?M_ID=84bd7a59-4bfe-4c99-8408-e1addef1160d&&querystr=&&CurrentPage=0&&PageSize=10&&token=";
        HttpUtil.okHttpGetMethod(url, this, 10000);
    }

    @Override
    public void onResponse(String result, int code) {
        presenter.setData2Presenter(result);
    }

    @Override
    public void onError(int code) {
        presenter.setError2Presenter("服务器异常");
    }
}
